//
//  WmcTeamInviteMemberNoteView.swift
//  YPWatermarkCamera
//
//  Created by yupao_ios_macmini06 on 2022/9/14.
//

import UIKit

class WmcTeamInviteMemberNoteView: WmcBaseView {
    var teamId: String? {
        didSet {
            guard let teamId = teamId else {
                return
            }
            self.teamIdLabel.text = "团队号：\(teamId)"
        }
    }

    override func makeUI() {
        backgroundColor = UIColor.wmc_blue_477EFF

        addSubview(teamIdStackView)
        teamIdStackView.addArrangedSubview(teamIdLabel)
        teamIdStackView.addArrangedSubview(copyBtn)
        addSubview(noteLabel)
        teamIdStackView.snp.makeConstraints { make in
            make.top.equalTo(8)
            make.centerX.equalToSuperview()
            make.height.equalTo(18)
        }
        noteLabel.snp.makeConstraints { make in
            make.top.equalTo(teamIdStackView.snp.bottom).offset(4)
            make.centerX.equalToSuperview()
            make.bottom.equalTo(-8)
        }
    }

    lazy var teamIdStackView: UIStackView = {
        let view = UIStackView()
        view.alignment = .fill
        view.distribution = .equalSpacing
        view.spacing = 8
        view.axis = .horizontal
        return view
    }()

    lazy var teamIdLabel: UILabel = {
        let view = UILabel()
        view.textColor = UIColor.wmc_grayH8_8A8A99
        view.font = 14.yp.uiFont
        view.text = "团队号：123456"
        return view
    }()

    lazy var copyBtn: UIButton = {
        let view = UIButton()
        view.titleLabel?.textColor = UIColor.wmc_blue_5290FD
        view.setTitleColor(UIColor.wmc_blue_5290FD, for: .normal)
        view.setTitleColor(UIColor.wmc_blue_5290FD, for: .highlighted)
        view.setTitle("复制", for: .normal)
        view.setTitle("复制", for: .highlighted)
        view.titleLabel?.font = 14.yp.uiFont
        return view
    }()

    lazy var noteLabel: UILabel = {
        let view = UILabel()
        view.textColor = UIColor.wmc_grayH8_8A8A99
        view.font = 14.yp.uiFont
        view.text = "成员可通过搜索【团队号】加入"
        return view
    }()
}
